package us.icitap.cm.ui.policecase;

import java.io.Serializable;

import us.icitap.cm.business.entities.EntityTypeEnum;
import us.icitap.cm.business.entities.ReportTypeEnum;

import com.vaadin.ui.Tree;

public class EventReportTree extends Tree implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = 8701020900874863821L;

	public EventReportTree(){
		this.addItem(ReportTypeEnum.ER);
		this.setItemCaption(ReportTypeEnum.ER, ReportTypeEnum.ER.getCaption());
		
		this.addItem(EntityTypeEnum.PLACE);
		this.setItemCaption(EntityTypeEnum.PLACE, EntityTypeEnum.PLACE.getCaption());
		
		this.addItem(EntityTypeEnum.PERSON);
		this.setItemCaption(EntityTypeEnum.PERSON, EntityTypeEnum.PERSON.getCaption());
		
		this.addItem(EntityTypeEnum.DOCUMENT);
		this.setItemCaption(EntityTypeEnum.DOCUMENT, EntityTypeEnum.DOCUMENT.getCaption());
		
		this.addItem(EntityTypeEnum.VEHICLE);
		this.setItemCaption(EntityTypeEnum.VEHICLE, EntityTypeEnum.VEHICLE.getCaption());

		this.addItem(EntityTypeEnum.ITEM);
		this.setItemCaption(EntityTypeEnum.ITEM, EntityTypeEnum.ITEM.getCaption());
		
		this.addItem(EntityTypeEnum.DRUG);
		this.setItemCaption(EntityTypeEnum.DRUG, EntityTypeEnum.DRUG.getCaption());
		
		this.addItem(EntityTypeEnum.WEAPON);
		this.setItemCaption(EntityTypeEnum.WEAPON, EntityTypeEnum.WEAPON.getCaption());
		
		this.addItem(EntityTypeEnum.ORGANIZATION);
		this.setItemCaption(EntityTypeEnum.ORGANIZATION, EntityTypeEnum.ORGANIZATION.getCaption());
		
		this.addItem(EntityTypeEnum.OFFICER);
		this.setItemCaption(EntityTypeEnum.OFFICER, EntityTypeEnum.OFFICER.getCaption());
		
		this.addItem(EntityTypeEnum.CONTROL);
		this.setItemCaption(EntityTypeEnum.CONTROL, EntityTypeEnum.CONTROL.getCaption());
		

		this.addItem("ASSOCIATIONS");
		this.setItemCaption("ASSOCIATIONS", "Lidhjet");
		
	
		this.setParent(EntityTypeEnum.PLACE, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.PERSON, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.DOCUMENT, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.VEHICLE, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.DRUG, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.WEAPON, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.ITEM, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.NUMBER, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.ORGANIZATION, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.OFFICER, ReportTypeEnum.ER);
		this.setParent(EntityTypeEnum.CONTROL, ReportTypeEnum.ER);
		
		this.setParent("ASSOCIATIONS", ReportTypeEnum.ER);
		
		this.expandItemsRecursively(ReportTypeEnum.ER);
		this.setImmediate(true);
	}
}
